Data encryption refers to converting plaintext into ciphertext through an encryption algorithm and an encryption secret key, and data decryption refers to restoring the ciphertext to the plaintext through the decryption algorithm and the decryption secret key. A core of the data encryption and the data decryption is cryptography.
In cryptography, to prevent the secret key from being decoded, encrypting and decrypting a two-dimensional bar code in different phases may constitute different solutions. A first solution is first encrypting an information source and then encoding the information source. In this solution, ciphertext is obtained after the two-dimensional bar code is decoded, and the ciphertext can be read only through a decryption program. A second solution is first encoding the source code into a code word and then encrypting the code word. Other solutions may be formed from a combination of the preceding solutions to encrypt the two-dimensional bar code. Since a two-dimensional bar code reader has been commercialized, any two-dimensional bar code meeting national standards can be decoded into information by the two-dimensional bar code reader.
In the related art, it is common to use a random number as the secret key. A lot of researches on a random number generator have been conducted. However, up to now, no one has proved that a digital sequence is completely random; however, it is difficult to find out the law of the random number. The random number generator used for the secret key includes ANSIX9.17 and FIPS186 of Federal Information Processing Standards. Although the random number generator supports for the problem of deciphering the secret key, but it does not solve an authentication problem of who generates the random number.
In the related art, a common practice in information management is storing information about an item in a two-dimensional bar code, and the information about the item can be read automatically through recognition of the two-dimensional code. However, the two-dimensional code is easy to be recognized and counterfeited, so the two-dimensional code has a poor anti-counterfeit function.